package com.beiding;

import com.beiding.my.mql.MQLBuilder;
import com.beiding.my.mql.MQLExecutor;
import com.beiding.test.be.Student;
import com.beiding.test.be.Teacher;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

import java.util.List;
import java.util.Map;

@SpringBootApplication
public class CodecreaterApplication {

    public static void main(String[] args) {
        ConfigurableApplicationContext context = SpringApplication.run(CodecreaterApplication.class, args);

        MQLBuilder builder = context.getBean(MQLBuilder.class);

        MQLExecutor executor = builder.build("select student.* from Student student where student.name=:p1 and student.teacher.name=:p2");

        Student student = (Student) executor.queryOne("丁常磊", "石满");

        System.out.println(student.getName());

        /*Student student = (Student) executor.queryOne("丁常磊", "石满");

        System.out.println(student.getName());

        Teacher teacher = student.getTeacher();

        System.out.println(teacher.getName());

        List<Student> list = executor.queryList("丁常磊", "石满");

        for (Student student1 : list) {
            System.out.println(student1.getName());
        }

        */


    }


    //TODO 重新明确bo be 的概念,be层改为data,bo层改为be

    //TODO 去掉Bo 和 Be间的Vo层

    //TODO Bo层创建public的无参构造

    //TODO Bo层使用 _be 指向be层


}

